/*
2021-7-26
https://www.acwing.com/problem/content/description/3784/
*/
#include<iostream>

using namespace std;

int main()
{
    int T;
    cin>>T;
    while(T--)
    {
        int n,m;
        cin>>n>>m;
        int res=0,sum=0;
        while(n--)
        {
            int x;
            cin>>x;
            if(x+sum>m) res++,sum=0;
            sum+=x;
        }
        if(sum) res++;
        cout<<res<<endl;
    }
    return 0;
}
